Skip to content

Conversation

@ArgoZhang
Copy link
Member

@ArgoZhang ArgoZhang commented Dec 30, 2025

Link issues

fixes #7442

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

New Features:

  • Expose a ShowFileName option in the PdfReader sample to control whether the PDF file name is displayed.

Copilot AI review requested due to automatic review settings December 30, 2025 05:10
@bb-auto bb-auto bot added the enhancement New feature or request label Dec 30, 2025
@bb-auto bb-auto bot added this to the v10.1.0 milestone Dec 30, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 30, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a new ShowFileName toggle to the PdfReader sample, wiring it through the demo UI and backing field so the sample can demonstrate the new PdfReader parameter.

Sequence diagram for ShowFileName toggle in PdfReader demo

sequenceDiagram
    actor User
    participant Browser
    participant PdfReaders_component
    participant PdfReader_component

    User->>Browser: Click_ShowFileName_Switch
    Browser->>PdfReaders_component: Update__showFileName_binding
    PdfReaders_component->>PdfReaders_component: State_has_changed
    PdfReaders_component->>PdfReader_component: Render_with_ShowFileName=_showFileName
    PdfReader_component-->>User: Display_viewer_with_filename_shown_or_hidden
Loading

Updated class diagram for PdfReaders component and PdfReader parameter

classDiagram
    class PdfReaders {
        bool _enableThumbnails
        bool _showDownload
        bool _showToolbar
        bool _showFileName
        string _url
        string _streamFileName
    }

    class PdfReader {
        string Url
        bool EnableThumbnails
        bool ShowTwoPagesOneView
        bool ShowDownload
        bool ShowToolbar
        bool ShowPrint
        bool ShowFileName
        string ViewHeight
        OnGetStreamAsync OnGetStreamAsync
    }

    PdfReaders --> PdfReader : uses_in_Razor_markup
Loading

File-Level Changes

Change Details Files
Expose the new ShowFileName parameter in the PdfReader sample and bind it to a UI toggle.
  • Add a ShowFileName switch control to the PdfReaders sample form alongside existing toggles
  • Introduce a new _showFileName backing field with default true in the PdfReaders code-behind
  • Pass the _showFileName value into the PdfReader component via the new ShowFileName parameter
src/BootstrapBlazor.Server/Components/Samples/PdfReaders.razor
src/BootstrapBlazor.Server/Components/Samples/PdfReaders.razor.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#7442 Add a ShowFileName parameter to the PdfReader component API so that consumers can control whether the file name is shown. The diff only updates the sample PdfReaders.razor and its code-behind to bind a new _showFileName field and pass ShowFileName to . There are no changes to the PdfReader component implementation itself (no new parameter/property is added in the library code), so the feature addition to the component API is not shown as implemented in this PR.
#7442 Expose the ShowFileName option in the PdfReader sample/demo so users can toggle it.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ArgoZhang ArgoZhang merged commit aecd38c into main Dec 30, 2025
6 of 8 checks passed
@ArgoZhang ArgoZhang deleted the feat-pdf branch December 30, 2025 05:11
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d4ad723) to head (33e8701).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7443   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          749       749           
  Lines        32911     32911           
  Branches      4573      4573           
=========================================
  Hits         32911     32911           
Flag Coverage Δ
BB 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a ShowFileName parameter to the PdfReader component, allowing users to control whether the PDF filename is displayed in the reader UI. The implementation follows the existing pattern for similar boolean toggle parameters in the sample page.

Key Changes:

  • Added ShowFileName boolean parameter with default value of true
  • Created UI toggle control for ShowFileName parameter
  • Updated BootstrapBlazor.PdfReader package from version 10.0.23 to 10.0.24

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/BootstrapBlazor.Server/Components/Samples/PdfReaders.razor.cs Added private boolean field _showFileName initialized to true
src/BootstrapBlazor.Server/Components/Samples/PdfReaders.razor Added UI toggle for ShowFileName and bound it to PdfReader component parameter
src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj Updated PdfReader package version to 10.0.24 to support new ShowFileName parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 60 to +62
<PdfReader Url="@_url" EnableThumbnails="_enableThumbnails"
ShowTwoPagesOneView="_showTwoPagesOneView" ShowDownload="_showDownload"
ShowToolbar="_showToolbar" ShowPrint="_showPrint"
ShowToolbar="_showToolbar" ShowPrint="_showPrint" ShowFileName="_showFileName"
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The boolean parameters passed to the PdfReader component are missing the @ symbol. In Blazor, when passing variable values as component parameters, you need to use @ to indicate it's a C# expression rather than a string literal. Without @, these parameters are being passed as the literal strings "_enableThumbnails", "_showTwoPagesOneView", etc., instead of the actual boolean values.

All boolean parameters on lines 60-62 need to be corrected:

  • EnableThumbnails should be EnableThumbnails="@_enableThumbnails"
  • ShowTwoPagesOneView should be ShowTwoPagesOneView="@_showTwoPagesOneView"
  • ShowDownload should be ShowDownload="@_showDownload"
  • ShowToolbar should be ShowToolbar="@_showToolbar"
  • ShowPrint should be ShowPrint="@_showPrint"
  • ShowFileName should be ShowFileName="@_showFileName"

This is a pre-existing issue affecting all parameters except Url, but it should be fixed as part of this PR since you're already modifying this line.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(PdfReader): add ShowFileName parameter

2 participants